package com.wc.AlgoOJ_train.train1.c4.A412;

import java.math.BigDecimal;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/10 15:13
 * @description Just a Number
 * http://43.138.190.70:8888/p/A412
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            BigDecimal b = new BigDecimal("1");
            int n = sc.nextInt();
            int m = sc.nextInt();
            System.out.println(b.divide(new BigDecimal(String.valueOf(n)),  m + 1, BigDecimal.ROUND_DOWN).toString().charAt(1 + m));
        }
    }
}
